package com.zhku.zeng.wxdev.controller;

import jdk.nashorn.internal.ir.RuntimeNode;
import org.springframework.http.HttpRequest;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.net.URI;
import java.net.URL;
import java.util.Enumeration;

@RestController
public class WxController {

    @RequestMapping("/wx")
    public Object test(HttpServletResponse response, HttpServletRequest request , String echostr) throws IOException {
        String token = "zengyonglin";
        String remoteAddr = request.getRemoteAddr();
        System.out.println(remoteAddr);


        if (StringUtils.isEmpty(echostr)) {
            return "";
        }
        return echostr;

    }
}
